package org.hxzon.demo.scala.matchdemo

object AnyMatch {
  def processCoordinates(input: Any) {
    input match {
      case (a: Int, b: Int) => printf("Processing (%d,%d)...\n", a, b)
      case (a: Double, b: Double) => printf("(%f,%f)\n", a, b)
      case "done" => println("Done")
      case _ => println("Other")
    }
  }
  def main(args: Array[String]): Unit = {
    processCoordinates((39, -104)) //Processing (39,-104)...
    processCoordinates((39.1, -104)) //Other
    processCoordinates((39.1, -104.2)) //(39.100000,-104.200000)
    processCoordinates("done") //Done
    processCoordinates("Hello") //Other
  }
}
